<template>
  <div>
    <el-dialog title="工序计划详情"  width="1100px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
      <el-form ref="form" :model=" sfcProplanform " size="small" label-width="80px" :inline="true" class="header">
        <el-row>
          <el-col :span="8">
            <el-form-item label="工序计划单据编号:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.billNo }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="物料名称:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.materialName }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="物料编码:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.materialNo }}
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="规格型号:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.specification }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单位名称:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.unitName }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="数量:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.qty }}
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="生产订单编号:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.moBiillNo }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工序说明:" label-width="130px" class="no-wrap-label">
              {{ sfcProplanform.describe1 }}
            </el-form-item>
          </el-col>
        </el-row>
        <br />
      </el-form>

      <el-table :data="sfcProplandetailList" height="calc(100vh - 300px)">
        <!--        <el-table-column label="No." width="60" align="right" type="index"></el-table-column>-->
        <el-table-column label="工序计划单据编号" width="130" prop="billNo"></el-table-column>
        <el-table-column label="加工车间编码" width="120" prop="departNo"></el-table-column>
        <el-table-column label="加工车间名称" width="120" prop="departName"></el-table-column>
        <el-table-column label="工序号" width="120" prop="operNo"></el-table-column>
        <el-table-column label="作业编码" width="120" prop="processNo"></el-table-column>
        <el-table-column label="作业名称" width="120" prop="processName"></el-table-column>
        <el-table-column label="工序数量" width="120" prop="qty"></el-table-column>
        <el-table-column label="设备编码" width="120" prop="equipmentNo"></el-table-column>
        <el-table-column label="设备名称" width="120" prop="equipmentName"></el-table-column>
      </el-table>


    </el-dialog>

  </div>
</template>
<script>
import { detail  } from '@/api/app/proplan'
export default {
  name:'proplandetail',
  props: {
    show: {
      type: Boolean,
      default: true
    },
    size: {
      type: String,
      default: 'mini'
    },
    info: {
      type: Object,
    },
  },
  data() {
    return {
      sfcProplanform:{},
      sfcProplandetailList:[]
    }
  },
  watch:{
    show(val){
      if(val){
      }
    }
  },
  methods: {
    open(){

      detail(this.info).then(res => {

        if (res.status == 200) {
          this.sfcProplanform = res.data.data;
          this.sfcProplandetailList = res.data.dataList;
          console.log('receList',this.receList)

        } else {
          this.$message.error('获取详情失败2，请稍后再试');
        }
      }).catch(error => {

        this.$message.error('获取详情失败，请稍后再试');
      });
    },
    closeForm(){
      this.$emit('update:show', false)
    }
  }
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss';
</style>